{% extends "base.html" %}

{% block title %}{{ title }} | {{ app_name }}{% endblock %}

{% block head %}
<link href='/static/css/buy.css' rel='stylesheet' type='text/css'>
{% endblock %}

{% block content %}

<h1>{{ title }}</h1>
<center>
<nav class='page_nav'>
	{% if items.number != 1 and  1 != items.previous_page_number %}
		<a href='{{ url }}page_no=1'>1</a> 
	{% endif %}

	{% if items.has_previous %}
		<a href='{{ url }}page_no={{ items.previous_page_number }}'>{{ items.previous_page_number }}</a> 
	{% endif %}

	<a>{{ items.number }}</a>

	{% if items.has_next %}
		<a href='{{ url }}page_no={{ items.next_page_number }}'>{{ items.next_page_number }}</a> 
	{% endif %}

	{% if items.number != items.paginator.num_pages and  items.paginator.num_pages != items.next_page_number %}
		<a href='{{ url }}page_no={{ num_pages }}'>{{ items.paginator.num_pages }}</a> 
	{% endif %}
</nav>
</center>
<table id='item_table'>
	<tr class='blank'>
		<td colspan=2></td>
	</tr>
	{% for item in items.object_list %}
	<tr class='first'>
		<td><a href='{{ item.get_url }}'>{{ item.title }}</a></td>
		<td><i>by <a href='{{ item.user.get_url }}'>{{ item.user.nick }}</a></i></td>
	</tr>
	<tr class='second'>
		<td>{{ item.descrip }}</td>
		<td><b>Price</b>: {{ item.price }}</td>
	</tr>
	<tr class='blank'>
		<td colspan=2></td>
	</tr>
	{% endfor %}
</table>
<center>
<nav class='page_nav'>
	{% if items.number != 1 and  1 != items.previous_page_number %}
		<a href='{{ url }}page_no=1'>1</a> 
	{% endif %}

	{% if items.has_previous %}
		<a href='{{ url }}page_no={{ items.previous_page_number }}'>{{ items.previous_page_number }}</a> 
	{% endif %}

	<a>{{ items.number }}</a>

	{% if items.has_next %}
		<a href='{{ url }}page_no={{ items.next_page_number }}'>{{ items.next_page_number }}</a> 
	{% endif %}

	{% if items.number != items.paginator.num_pages and  items.paginator.num_pages != items.next_page_number %}
		<a href='{{ url }}page_no={{ num_pages }}'>{{ items.paginator.num_pages }}</a> 
	{% endif %}
</nav>
</center>
{% endblock %}



